package com.bibrApp.difu.actvity.my_mvp;


import android.content.Context;
import android.content.Intent;

import com.bibrApp.difu.R;
import com.bibrApp.difu.actvity.account_info_mvp.AccountInfoActivity;
import com.bibrApp.difu.actvity.df_u_mvp.UActivity;
import com.bibrApp.difu.actvity.pay_setting_mvp.PaySettingActivity;
import com.bibrApp.difu.actvity.security_setting_mvp.SecuritySettingActivity;
import com.bibrApp.difu.actvity.security_strategy_mvp.SecurityActivity;
import com.bibrApp.difu.base.BaseActivity;
import com.bibrApp.difu.utils.IntentUtil;
import com.bibrApp.difu.utils.ToastUtils;
import com.gyf.barlibrary.ImmersionBar;

import androidx.annotation.Nullable;

import butterknife.OnClick;

public class MyActivity extends BaseActivity<MyPresenter> implements IMyView {

    private ImmersionBar mImmersionBar;
    private Context mContext;

    @Override
    protected void initPresenter() {
        presenter = new MyPresenter(this, this);
        presenter.init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_my;
    }

    @Override
    public void initView() {
        mContext = this;
        mImmersionBar = ImmersionBar.with(this);
        mImmersionBar.statusBarColor(R.color.white)
                .statusBarDarkFont(true)
                .fitsSystemWindows(true)
                .init();
    }


    @Override
    public void error(String msg) {
        ToastUtils.ShowToast(mContext, msg);
    }

    @Override
    public void success(String msg) {

    }

    @OnClick(R.id.return_iv)
    public void onClickBack() {
        finish();
    }

    @OnClick(R.id.my_account_rl)
    public void onClickMyAccountInfo() {
        IntentUtil.toActivity(AccountInfoActivity.class, this);
    }

    @OnClick(R.id.ic_safe_my_rl)
    public void onClickSafeSettingInfo() {
        IntentUtil.toActivity(SecuritySettingActivity.class, this);
    }

    @OnClick(R.id.ic_Strategy_my_rl)
    public void onClickSecurityStrategy() {
        IntentUtil.toActivity(SecurityActivity.class, this);
    }

    @OnClick(R.id.ic_pay_my_rl)
    public void onClickPaySetting() {
        IntentUtil.toActivity(PaySettingActivity.class, this);
    }

    @OnClick(R.id.ic_u_my_rl)
    public void onClickU() {
        IntentUtil.toActivity(UActivity.class, this);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mImmersionBar != null) {
            mImmersionBar.destroy();
        }

    }

}
